package com.gs.threadpackage;

/**
 * @ProjectName: springbootmybitstest
 * @Package: com.gs.threadpackage
 * @Description: java类作用描述
 * @Author: Administrator
 * @CreateDate: 2018/6/28 11:19
 * @UpdateUser: Administrator
 * @UpdateDate: 2018/6/28 11:19
 * @UpdateRemark: The modified content
 * @Version: 1.0
 **/
public class Producer implements Runnable{
    private Clerk clerk;

    public Producer(Clerk clerk){
        this.clerk=clerk;
    }
    @Override
    public void run() {
        System.out.println("生产者开始生产产品");
   while (true){

              try {
                  Thread.sleep(1000);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
              clerk.addProduct();

         }
    }
}
